package com.example.mattrigle.Sound;

import com.example.mattrigle.R;

import android.content.Context;
import android.media.MediaPlayer;

public class SoundGame {
private MediaPlayer mediaplayer ;
private static SoundGame soundGame;
public static SoundGame getInstance(){
	if(soundGame == null){
		soundGame = new SoundGame();
	}
	return soundGame;
}
public void playSoundMenu(Context context){
	stopSound();
	mediaplayer = MediaPlayer.create(context, R.raw.piano);
	mediaplayer.setLooping(true);
	mediaplayer.setVolume(0.7f, 0.7f);
	mediaplayer.start();
}
public void playSoundPlayGame(Context context){
	stopSound();
	mediaplayer = MediaPlayer.create(context, R.raw.jazzloop3_60);
	mediaplayer.setLooping(true);
	mediaplayer.setVolume(1.0f, 1.0f);
	mediaplayer.start();
}
public void playSoundButton(Context context){
	stopSound();
	mediaplayer = MediaPlayer.create(context, R.raw.multimedia_button_click_029);
	mediaplayer.setVolume(1.0f, 1.0f);
	mediaplayer.start();
}
public void playSoundGameComplete(Context context){
	stopSound();
	mediaplayer = MediaPlayer.create(context, R.raw.orchestra);
	mediaplayer.setVolume(1.0f, 1.0f);
	mediaplayer.start();
}
public void stopSound(){
	if(mediaplayer != null){
		mediaplayer.release();
	}
}
}
